package com.avhdeveloper.interceptors;

import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;



public class SysoutInterceptor extends AbstractInterceptor{

  private static final long serialVersionUID = 1L;
  
  private String suffix;

  @Override
  public String intercept(ActionInvocation invocation) throws Exception {
    String result;
    System.out.println("SysoutInterceptor is about to call the method " + (getSuffix()==null?"":getSuffix()));
    result = invocation.invoke();
    System.out.println("SysoutInterceptor is done calling the method " + (getSuffix()==null?"":getSuffix()));
    return result;
  }

  public void setSuffix(String suffix) {
    this.suffix = suffix;
  }

  public String getSuffix() {
    return suffix;
  }
}
